<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CMS</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/jumbotron.css" rel="stylesheet">
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.min.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">body{background-color: #eee;}</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top"></nav>

<div class="jumbotron">
    <div class="container">
        <form class="form-horizontal col-lg-offset-4">
            <div class="form-group text-center">
                <label for="pwd1" class="col-lg-2 control-label">原有密码</label>
                <div class="col-lg-3">
                    <input type="password" class="form-control" id="pwd1" required autofocus>
                </div>
            </div>
            <div class="form-group text-center">
                <label for="pwd2" class="col-lg-2 control-label">重设密码</label>
                <div class="col-lg-3">
                    <input type="password" class="form-control" id="pwd2" required>
                </div>
            </div>
            <div class="form-group text-center">
                <label for="pwd3" class="col-lg-2 control-label">二次确认</label>
                <div class="col-lg-3">
                    <input type="password" class="form-control" id="pwd3" required>
                </div>
            </div>
            <div class="form-group text-center">
                <div class="col-lg-offset-2 col-lg-3">
                    <button type="button" class="btn btn-primary" id="btn-sub">保存</button>
                </div>
            </div>
        </form>
    </div> <!-- /container -->
</div>



<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/url.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/CryptoJS/rollups/md5.js"></script>
<script src="js/common.js"></script>
<script language="JavaScript">
    $(function(){
        auth();
        menu("user");
    });

    $("#btn-sub").click(function(){
        if($("#pwd2").val() == ""){
            return msgErr("请输入新密码！");
        }
        if($("#pwd2").val() != $("#pwd3").val()){
            msgErr("密码二次输入不一致！");
        }else if(checkStrong($("#pwd2").val()) == false) {
            msgErr("密码强度不够，必须包含6位以上数字、大小字母、特殊字符组合！");
        }else{
            api.pwd({
                "p1":CryptoJS.MD5($("#pwd1").val()).toString(),
                "p2":CryptoJS.MD5($("#pwd2").val()).toString(),
                "id":localStorage["login-uid"]
            });
        }
    })
</script>
</body>
</html>